# Impute covariates -------------------------------------------------------

covariate_frame <- lab[,lab_covariates]

covariate_imp <- mice(data = covariate_frame,m = 1,seed = 1234567)
covariate_imp <- mice::complete(covariate_imp)

lab[,lab_covariates] <- covariate_imp[,lab_covariates]

rm(covariate_frame,covariate_imp)

# Impute outcomes ---------------------------------------------------------

# absenteeism
abs_outcomes <- abs_outcomes_lab

abs_frame <- lab[,abs_outcomes]

abs_imp <- mice(data = abs_frame,m = 1,seed = 1234567)
abs_imp <- mice::complete(abs_imp,action = 1)

lab[,abs_outcomes] <- abs_imp[,abs_outcomes]

rm(abs_frame,abs_imp)


